package com.ghy.dto;

import com.ghy.constant.RE;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;


import javax.validation.constraints.Future;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author GaoHeYang
 */
@Schema(name ="通知修改DTO")
@Data
public class SeckillUpdateDTO implements Serializable, RE {

    @NotNull(message = "主键不能为空")
    @Schema(description = "主键")
    private Long id;

    @NotNull(message = "秒杀标题不能为空")
    @Schema(description = "秒杀标题")
    private String title;

    @Schema(description = "秒杀描述")
    @Pattern(regexp = INFO_RE, message = INFO_RE_MSG)
    private String info;


    @Future(message = "生效时间必须是一个未来的时间")
    @NotNull(message = "生效时间不能为空")
    @Schema(description = "生效时间")
    private LocalDateTime startTime;

    @NotNull(message = "秒杀活动结束时间不能为空")
    @Schema(description = "秒杀活动结束时间")
    private LocalDateTime endTime;
}
